﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>jccc .NET smart framework - Manual</title>		
        <link rel="stylesheet" type="text/css" href="csharp.css" />
	</head>
	<body>
	    <h1>jccc .NET smart framework - Manual</h1>
	    <h2>Introduction</h2>
	    <p>
	        jccc .NET smart framework allows the creation of fast connections to MSSQL or 
            MYSQL databases, and the data manipulation by using of c# class&#39;s that 
            represents the SQL tables in the databases.. As the following image represent's:
	    </p>
	        <table>
	        <tr>
	            <td><img src="jccc-databases.jpg"border="0px" alt="Database representation" /></td>
	            <td><img src="jccc-csharp-class.jpg" border="0px" alt="C# Class representation" /></td>
	        </tr>
	        </table>	        

	    <h2>Usage Examples</h2>
            <!-- code formatted by http://manoli.net/csharpformat/ -->
            <pre class="csharpcode">
            <span class="rem">//MSSQL database test</span>
            jccc.bd db1 = <span class="kwrd">new</span> jccc.bd(); <span class="rem">// connections string in app.config(windows client Aplication) or web.config(asp.net aplication) named: "conn"</span>
            Console.Out.WriteLine(<span class="str">"{0}"</span>, db1.executar_s(<span class="str">"SELECT count(*) FROM testes;"</span>));

            <span class="rem">//MySql database test</span>
            jccc.bd_mysql db2 = <span class="kwrd">new</span> jccc.bd_mysql(2); <span class="rem">// using connection string named: "conn2"</span>
            Console.Out.WriteLine(<span class="str">"{0}"</span>, db2.executar_s_int(<span class="str">"SELECT count(*) FROM testes"</span>));
            </pre>
            <img src="jccc-conn.jpg" border="0px" alt="Connections Strings" />     
            
            <!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">
            testes t1 = <span class="kwrd">new</span> testes();

            <span class="rem">//Testing insert's, updates and deletes, first record, next record, last record, previous record</span>
            Console.Out.WriteLine(<span class="str">"Insert {0}"</span>, db1.smart_insert(t1));
            Console.Out.WriteLine(<span class="str">"Insert and Return antes{0} {1} depois{2}"</span>, t1.id_teste, db1.smart_insert_return_id(t1), t1.id_teste);
            t1.campoteste1 = <span class="str">"update"</span>;
            Console.Out.WriteLine(<span class="str">"Update {0}"</span>, db1.smart_update(t1));
            Console.Out.WriteLine(<span class="str">"Select {0}"</span>, db1.smart_select(t1));
            Console.Out.WriteLine(<span class="str">"Delete {0}"</span>, db1.smart_delete(t1));
            Console.Out.WriteLine(<span class="str">"First {0} {1}"</span>, db1.smart_select_primeiro(t1), t1.id_teste);
            Console.Out.WriteLine(<span class="str">"Next {0} {1}"</span>, db1.smart_select_seguinte(t1), t1.id_teste);
            Console.Out.WriteLine(<span class="str">"Last {0} {1}"</span>, db1.smart_select_ultimo(t1), t1.id_teste);
            Console.Out.WriteLine(<span class="str">"Previous {0} {1}"</span>, db1.smart_select_anterior(t1), t1.id_teste);    </pre>       
	</body>
</html>